{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">新增采购单 [ <a href="__URL__/fastadd">批量导入</a> ]</h3>
<div id="result" class="result none"></div>
<form class="form-horizontal well" method='post' name="form1" id="form1" action="__URL__/insert/">
<table cellpadding=3 cellspacing=3 >

<tr>
    <td width="150px">采购单号：</td>
	<td>
            <input  class="large" name="buy_no" value="">留空则自动生成
            <strong>采购时间</strong> ：<input type="text" class="span2" name="create_time" value="{:toDate(time())}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
        </td>
</tr>
<!--
<tr>
    <td class="tRight" width="150px">按<b>条码</b>查询产品：</td>
	<td class="tLeft" >
            <input id="ptm" name="ptm_id" style="width:700px"></input>
            <br/><a class="btn btn-primary" href="javascript:void(0)" onclick="showdetail('ptm');">添加产品</a>
        </td>
</tr> -->
<tr>
    <td class="tRight" >按<b>汉字</b>查询产品：</td>
    <td class="tLeft" >
            <div class="input-append">
                <input id="q" name="q" class="input-xxlarge search-query" placeholder="搜索"><input id="hz" name="hz_id" type="hidden"></input>
                <button class="btn" type="button" onclick="filter('buy')"><i class="icon-search"></i>搜索</button>
                <span class="help-inline alert">支持空格查询,如:名称 + 度数</span>
            </div>
        </td>
</tr>
<tr>
    <td colspan="2" class="alert">注意：如果是买几送几的，买的先录入，紧接着录入送的，并且送的产品的进价数量保持为0.</td>
</tr>
<tr>
	<td class="tRight">选择的产品：</td>
        <td class="tLeft">
            <table id="chosed_product" name="ptable" class="table table-bordered table-striped">
                <thead><tr><th width="85px">条码</th><th width="200px">名称</th><th>规格</th> <th>进价</th><th>数量</th><th>单位</th><th>库存</th><th width="75px">生产批号</th><th width="75px">截止有效期</th><th>删除</th></tr></thead>
            </table>
        </td>
</tr>
<tr>
	<td class="tRight" >供应商：</td>
	<td class="tLeft" >
    {:modList('Supplier')}
            仓库：<select name="warehouse_id">
                <volist name="warehouses" id="ue">
                <option value="{$key}">{$ue}</option>
                </volist>
            </select>
            经办人：<select name="user_id" class="input-small">
                <volist name="users" id="us">
                <option value="{$key}" <eq name="_SESSION[C('USER_AUTH_KEY')]" value="$key">selected</eq> >{$us}</option>
                </volist>
            </select>
            
            
        </td>
</tr>
<tr>
	<td class="tRight">备注：</td>
        <td class="tLeft"><textarea class="span12" name="remark" rows="4"></textarea>
        </td>
</tr>
<tr>
	<td></td>
	<td class="center" width="300">
	<input type="hidden" name="ajax" value="1">
    <input type="hidden" name="jumpUrl" value="__URL__">
	<button type="button" onclick="sendForm('form1','__URL__/insert/','tips','__URL__')" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
    <a class="btn btn-primary offset1" href="__URL__"><i class="icon-arrow-left icon-white"></i>返回</a>
	</td>
</tr>
<tr>
    <td colspan="2" class="alert">注意：提示信息在右上角,请注意查看</td>
</tr>
</table>
</form>
</div>
</div>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<include file="Public:footer" />
<script type="text/javascript"> 
    document.onkeydown=function enterToTab() 
    { 
    if(event.srcElement.type != 'submit' && event.srcElement.type!="image" && event.srcElement.type != 'textarea' 
    && event.keyCode == 13) 
        event.keyCode = 9; 
    } 
</script>
